import java.util.Scanner;

public class duanluyunsuanfuDemo {
    public static void main(String[] args) {
        System.out.println("请输入第一个整数：");
        Scanner sc=new Scanner(System.in);
        int number1=sc.nextInt();
        System.out.println("请输入第二个整数：");
        int number2=sc.nextInt();
        System.out.println(number1==6 || number2==6 || (number1+number2)%6==0);
        sc.close();
    }
}
